import { combineReducers } from "redux";
import { GET_USER, DEL_USER, GET_MENU, DEL_MENU } from '../action'

function Info(state = [], action) {
  let { type, userInfo } = action;
  switch (type) {
    case GET_USER:
      //处理数据
      state = userInfo;
      return { ...state };

    case DEL_USER:
      //处理数据
      return {};

    default:
      return state;
  }
}

function Menu(state = [], action) {
  let { type, userMenu } = action;
  switch (type) {
    case GET_MENU:
      //处理数据
      state = userMenu;
      return [...state];

    case DEL_MENU:
      //处理数据
      return [];

    default:
      return state;
  }
}



export default combineReducers({
  Info,
  Menu
});
